<?php
/**
 *User.php    当前文件名
 *Administrator         当前用户
 *15:46         系统时间
 *yydati 工程名
 *PhpStorm IDE名称
 **/

namespace app\api\controller;


use app\admin\service\MemberService;
use app\BaseController;
use think\facade\Db;

class User extends BaseController
{
    public function getUserInfo()
    {
        $userId = $this->request->user_id;
        $userinfo = Db::name('member')->where('id', $userId)
            ->withoutField('password,login_region,signature,source,login_ip,status,create_time,mark,intro')
            ->find();
        return message("操作成功", true, $userinfo);
    }

    /**
     * 数据验证 控制器操作
     * TODO 数据验证模板
     */
    public function trainLog()
    {
        $params = input('post.');
        $rule = [
            'phone|手机号码' => 'require|mobile',
        ];
        $validate = \think\facade\Validate::rule($rule);
        if (!$validate->check($params)) {
            return message($validate->getError(), false);
        }

    }
}